package q1.project.modules.system.user.model;

import java.time.LocalDateTime;
import q1.project.core.base.PageQuery;

/**
 * @author Q1 Team
 */
public final class UserVm {
  private UserVm() {}

  public record UserResponse(
      String id,
      String username,
      String nickname,
      String email,
      String phone,
      String avatar,
      String status,
      LocalDateTime lastLoginTime,
      LocalDateTime createTime,
      LocalDateTime updateTime,
      String remark,
      String tenantId,
      String tenantName,
      Boolean isOnline) {}

  public record UserCreate(
      String username,
      String password,
      String nickname,
      String email,
      String phone,
      String avatar,
      String status,
      String remark) {}

  public record UserUpdate(
      String nickname, String email, String phone, String avatar, String status, String remark) {}

  public static class UserQuery extends PageQuery {
    private String keyword;
    private String status;

    public String getKeyword() {
      return keyword;
    }

    public void setKeyword(String keyword) {
      this.keyword = keyword;
    }

    public String getStatus() {
      return status;
    }

    public void setStatus(String status) {
      this.status = status;
    }
  }

  @lombok.Data
  public static class OnlineUserResponse {
    private String sessionId;
    private String userId;
    private String username;
    private String nickname;
    private String tenantId;
    private LocalDateTime loginTime;
    private LocalDateTime lastActiveTime;
    private String ipAddress;
    private String browser;
  }

  public record CheckOnlineStatusResponse(boolean isOnline) {}

  public record UserStatsResponse(
      long totalUsers, long onlineUsers, long bannedUsers, long todayNewUsers) {}

  public record BanUserRequest(String reason, Integer days) {}

  public record MuteUserRequest(String reason, Integer hours) {}
}
